package restless.core.managers {

	import restless.core.interfaces.ILevel;
	import restless.core.interfaces.IScore;
	import restless.core.gameObjs.RLEUpdateRenderObj;
	
	
	import flash.display.DisplayObject;
	
	public class RLELevelManager extends RLEUpdateRenderObj {

		private var levels:Vector.<Class>;
		private var levelData:Vector.<IScore>;
		private var nLevel:int = 0;
		
		private var currLevel:ILevel;
		private var currData:IScore;
		
		public function RLELevelManager() {
			
		}
		
		public function load(levels:Vector.<Class>, levelData:Vector.<IScore>):void {
			this.levels = levels;
			this.levelData = levelData;
		}
		
		public function getLevel(num:int):ILevel {
			nLevel = num;
			var level:Class = levels[nLevel];
			currData = new levelData[nLevel];
			currLevel = new level();
			return currLevel;
		}
		
		public function disposeLevel():void {
			currLevel.dispose();
		}
		
		public function getCurrLevelData():IScore {
			return currData;
		}
	}
}